Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

feature/connections/src/jvmMain/kotlin/org/meshtastic/feature/connections/domain/usecase/JvmUsbScanner.kt 74dfd43ec2c13af9feb9b6c5fccf55977d83adb1 (74dfd43e) Text, 2.03 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.connections.domain.usecase

Tff7b72import T7ee787kotlinx.coroutines.delay
Tff7b72import T7ee787kotlinx.coroutines.flow.Flow
Tff7b72import T7ee787kotlinx.coroutines.flow.distinctUntilChanged
Tff7b72import T7ee787kotlinx.coroutines.flow.flow
Tff7b72import T7ee787kotlinx.coroutines.isActive
Tff7b72import T7ee787org.koin.core.annotation.Single
Tff7b72import T7ee787org.meshtastic.core.network.SerialTransport
Tff7b72import T7ee787org.meshtastic.feature.connections.model.DeviceListEntry
Tff7b72import T7ee787org.meshtastic.feature.connections.model.JvmUsbDeviceData
Tff7b72import T7ee787kotlin.coroutines.coroutineContext

Tf0883e@Single
Tff7b72class T56d364JvmUsbScanner Tb4b4b4: Te6edf3UsbScanner Tb4b4b4{
Tff7b72override Tff7b72fun Td2a8ffscanUsbDevicesTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3FlowTff7b72<Te6edf3ListTff7b72<Te6edf3DeviceListEntryTb4b4b4.Te6edf3UsbTff7b72>Tff7b72> Tff7b72= Te6edf3flow Tb4b4b4{
Tff7b72while Tb4b4b4(Te6edf3coroutineContextTb4b4b4.Te6edf3isActiveTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3ports Tff7b72=
Te6edf3SerialTransportTb4b4b4.Te6edf3getAvailablePortsTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3map Tb4b4b4{ Te6edf3portName Tff7b72-Tff7b72>
Te6edf3DeviceListEntryTb4b4b4.Te6edf3UsbTb4b4b4(
Te6edf3usbData Tff7b72= Te6edf3JvmUsbDeviceDataTb4b4b4(Te6edf3portNameTb4b4b4)Tb4b4b4,
Te6edf3name Tff7b72= Te6edf3portNameTb4b4b4,
Te6edf3fullAddress Tff7b72= Ta5d6ff"Ta5d6ffsTffd700$Te6edf3portNameTa5d6ff"Tb4b4b4,
Te6edf3bonded Tff7b72= Tff7b72trueTb4b4b4, T8b949e// Desktop serial ports don't need Android USB permission bonding
Te6edf3node Tff7b72= Tff7b72nullTb4b4b4,
Tb4b4b4)
Tb4b4b4}
Te6edf3emitTb4b4b4(Te6edf3portsTb4b4b4)
Te6edf3delayTb4b4b4(Te6edf3POLL_INTERVAL_MSTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4.Te6edf3distinctUntilChangedTb4b4b4(Tb4b4b4)

Tff7b72companion Tff7b72object Tb4b4b4{
Tff7b72private Tff7b72const Tff7b72val Te6edf3POLL_INTERVAL_MS Tff7b72= T79c0ff2T79c0ff0T79c0ff0T79c0ff0L
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.4 - Generated in 0.06s